/**
 * Created by ${PRODUCT_NAME}.
 * User: skyler
 * Date: 2/14/11
 * Time: 9:37 AM
 * To change this template use File | Settings | File Templates.
 */
package com.thoughtorigin.media {
import flash.events.Event;
import flash.net.NetStream;

public class MediaPlayerEvent extends Event {

    public static const MEDIA_LOADING_EVENT: String = "mediaLoadingEvent";
    public static const MEDIA_SEEK:String = "mediaSeek";
    public static const MEDIA_PAUSE:String = "mediaPause";
    public static const MEDIA_CLOSE:String = "mediaClose";
    public static const MEDIA_PLAY:String = "mediaPlay";
    public static const BUFFER_EMPTY:String = "bufferEmpty";
    public static const MEDIA_END:String = "mediaEnd";
    public static const MEDIA_START:String = "mediaStart";
    public static const MEDIA_TICK:String = "mediaTick";

    private var _netStream: NetStream;
    private var _metaData: MediaMetaData;

    public function MediaPlayerEvent(type: String, netStream: NetStream, metaData: MediaMetaData) {
        super(type, bubbles, cancelable);
        _netStream = netStream;
        _metaData = metaData;
    }

    public function get bytesTotal(): Number {
        return _netStream.bytesTotal;
    }

    public function get bytesLoaded(): Number {
        return _netStream.bytesLoaded;
    }

    public function get time(): Number {
        return _netStream.time;
    }

    public function get duration(): Number {
        return _metaData.duration;
    }
}
}
